import {createSlice} from "@reduxjs/toolkit"

const checkMenuReducer = createSlice({
    name:"menu",
    initialState:{
        menus:[
            {key:"/home/list",label:"商品管理",status:true}
        ]
    },
    reducers:{
       addMenu(state,action){
            state.menus.push(action.payload)
       },
       deleteMenu(state,action){
            //const id = action.payload 
       }
    }
})

export const {addMenu,deleteMenu} = checkMenuReducer.actions

export default checkMenuReducer.reducer